function getHashFn(X=13331n,Y=2n**64n){
    return function(str){
        let hashCode = 0n
        for (let i = 0; i < str.length; i++) {
            hashCode = hashCode*X + BigInt(str.codePointAt(i))
        }
        // 'abcde' hashCode 3063765792247093395n
        // console.log(hashCode)
        return hashCode % Y
    }
}

const hash = getHashFn()
const str = 'abcde'
console.log(hash(str))
